<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreMasterRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'master_name'		=> 'bail|required|min:2|max:32',
            'master_mobile'		=> 'bail|required',
			'master_code'		=> 'bail|required|min:15|max:18',
			'idcard_top_img'    => 'bail|required',
			'idcard_under_img'	=> 'bail|required',
        ];
    }
    
    public function messages()
	{
		return [
			'master_name.required'		=> '请填写店主姓名',
			'master_name.min'			=> '店主姓名最少为2位',
			'master_name.max'			=> '店主姓名超出最大字符限制',
			'master_mobile.required'	=> '请填写手机号码或座机号',
			'master_code.required'		=> '请填写15位或18位身份证号码',
			'master_code.min'			=> '请填写15位或18位身份证号码',
			'master_code.max'			=> '请填写15位或18位身份证号码',
			'idcard_top_img.required'	=> '请上传正面身份证照片',
			'idcard_under_img.required'	=> '请上传背面身份证照片',
		];
	}
}
